﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>

<%
	dim nid,tilte,hr,we0,we,sou,dao,zi,zi0,TP,Action
        id=Request.querystring("nid")
	if id="" then id=1
	if not isnumeric(id) then id=1
	id=clng(id)
Action=Request.QueryString("Action")
TP=trim(request("TP"))


select case v
case "0"
we0="<br/>"
tilte1="<card title=""删除相片""><p>"
tilte2="<card title=""相片设置""><p>"
case "1"
hr="<hr>"
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
tilte1="<title>删除相片</title></head><body>"
tilte2="<title>相片设置</title></head><body>"
End Select
%>
<%
if conn.execute("Select fid from [qingtian_Upfile] where id="&id&"")("fid")=qingtian.nid or qingtian.bbs=true then
if Action="p" Then
 Response.Write tilte1
		if sid<>"Null" then
		qingtian.info
		end if
Response.Write we
if TP<>"" then
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT id FROM qingtian_Upfile where id="&id,conn,1,1
if rs.eof then
 Response.Write "相片不存在<br/>"
else
  conn.Execute("delete from qingtian_Upfile Where id=" & id)
 Response.Write "相片删除成功！"
 Response.Write "<br/><a href=""index.asp?sid="&sidd&""">我的相册</a>"
  end if
  rs.close
  set rs=Nothing
else
 Response.Write "删除该相片？<br/>"
 Response.Write "<a href=""getsave.asp?action=p&amp;nid="&id&"&amp;sid="&sidd&"&amp;TP=1"">是的</a>"
 Response.Write "<br/><a href=""index.asp?sid="&sidd&""">取消</a>"
end if

else
Response.Write tilte2
		if sid<>"Null" then
		qingtian.info
		end if
Response.Write we
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT id,photoview FROM qingtian_Upfile where id="&id,conn,1,2
if rs.eof then
 Response.Write "相片不存在<br/>"
else
if rs("photoview")=1 then
rs("photoview")=0
else
rs("photoview")=1
end if
rs.update
end if
  rs.close
  set rs=Nothing
 Response.Write "相片设置操作成功！"
 Response.Write "<br/><a href=""photoview.asp?id="&id&"&amp;sid="&sidd&""">查看相片</a>"
 Response.Write "<br/><a href=""index.asp?sid="&sidd&""">我的相册</a>"
end if
else
Response.Write tilte2
qingtian.err("你没有管理该照片的权限")
end if
%>
<%=we0%><%=qingtian.qingsav("555")%>
<%=sou%><a href='photoview.asp?id=<%=id%>&amp;sid=<%=sidd%>'>返回阅读相片</a><%=we0%>
 
<%
End Function
%>
